<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css" />
<style>
.layui-form-label {
	width: 100px;
}
.layui-input-block {
	margin-left: 130px;
}
.wrap-container p{ color:#090; line-height:24px;}
.wrap-container p.title{color:#000; font-size:16px; font-weight:bold;}
</style>
</head>
<body>
<div class="wrap-container" style="padding:20px;">

</div>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script>
$(function(){
	$('.wrap-container').append('<p class="title">生成列表页：</p>');
	make_list("{:url('Make/batch_list',['make'=>1])}");	
});

function make_index(){
	$('.wrap-container').append('<p class="title">生成首页：</p>');
	$.get("{:url('Make/index')}",function(data){
		if(data != ''){
			$('.wrap-container').append('<p>'+data+'</p>');
			var h = $(document).height()-$(window).height();
				$(document).scrollTop(h);
			}
	});
}

function make_list(url){
	$.get(url,function(data){
		$('.wrap-container').append('<p>'+data.msg+'</p>');
		var h = $(document).height()-$(window).height();
		$(document).scrollTop(h);
		if(data.code==1){
			make_list(data.url);
		}else if(data.code == 0){
			$('.wrap-container').append('<p class="title">生成内容页：</p>');
			make_view("{:url('Make/batch_view',['make'=>1])}");	
		}else{
			return 1;	
		}	
	});	
}

function make_view(url){
	$.get(url,function(data){
		$('.wrap-container').append('<p>'+data.msg+'</p>');
		var h = $(document).height()-$(window).height();
		$(document).scrollTop(h);
		if(data.code==1){
			make_view(data.url);
		}else if(data.code == 0){
			make_index();	
		}else{
			return 1;	
		}
	});	
}

</script>
</body>
</html>